package com.tonann.app.mapper;

import com.tonann.app.domain.AppSensorRecord;
import com.tonann.app.domain.AppSensorRecordDay;
import com.tonann.app.domain.AppSensorRecordHour;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 运行记录Mapper接口
 *
 * @author tonann
 * @date 2022-10-21
 */
@Mapper
public interface AppSensorRecordHourMapper extends BaseMapper<AppSensorRecordHour> {
    /**
     * 查询运行记录
     *
     * @param recordId 运行记录主键
     * @return 运行记录
     */
    public AppSensorRecordHour selectAppSensorRecordHourByRecordId(Long recordId);

    /**
     * 查询运行记录列表
     *
     * @param appSensorRecord 运行记录
     * @return 运行记录集合
     */
    public List<AppSensorRecordHour> selectAppSensorRecordHourList(AppSensorRecordHour appSensorRecord);

    /**
     * 新增运行记录
     *
     * @param appSensorRecord 运行记录
     * @return 结果
     */
    public int insertAppSensorRecordHour(AppSensorRecordHour appSensorRecord);


    @Override
    public int insertBatch(List<AppSensorRecordHour> list);
    /**
     * 修改运行记录
     *
     * @param appSensorRecord 运行记录
     * @return 结果
     */
    public int updateAppSensorRecordHour(AppSensorRecordHour appSensorRecord);

    /**
     * 删除运行记录
     *
     * @param recordId 运行记录主键
     * @return 结果
     */
    public int deleteAppSensorRecordHourByRecordId(Long recordId);

    /**
     * 批量删除运行记录
     *
     * @param recordIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteAppSensorRecordHourByRecordIds(Long[] recordIds);

    AppSensorRecord selectPreNoZeroAppSensorRecordByTime(@Param("createTime") LocalDateTime createTime, @Param("sensorId") Long sensorId);

    List<AppSensorRecordHour> selectList(List<Long> list);
}
